package xkp.lesson4;

import java.util.Scanner;

public class TestFinally {
	public static void main(String[] args) {
//		
//		Scanner scanner = new Scanner(System.in);
//		int n = scanner.nextInt();
//		int m = scanner.nextInt();
//		int result = n/m;
//		System.out.println(result);
//		scanner.close();
//		
//		
		
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		try {
			int result = n/m;
			//如果出现异常，此处以及后面代码不再执行
			System.out.println(result);
		} catch (Exception e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}finally {
			System.out.println("----------");
			//此处放在finally中可以保证资源确定得到释放。
			scanner.close();
		}
		
	}

}
